{layout name="layout" /}
{load href="/static/js/laydate/laydate.js" /}
<link href="//tencent.beecdn.cn/libs/iCheck/1.0.2/skins/all.css" rel="stylesheet">
<link href="//tencent.beecdn.cn/libs/iCheck/1.0.2/skins/square/blue.css" rel="stylesheet">
<script src="//tencent.beecdn.cn/libs/jquery.touchswipe/1.6.19/jquery.touchSwipe.min.js"></script>
<div class="row hide">
    <div class='col-xs-12'>
        <ul class="nav nav-pills text-center text-black ">
            <li  class="{:input('state',0)==0?'activity':''} change_tab pull-left" style="width: 50%;margin-left:0px;">
                <a class="btn disabled text-muted" href="{:merge_url('half_list',['state'=>0]);}">记录</a></li>
            <li  class=" change_tab {:input('state',0)==1?'activity':''} pull-right"  style="width: 50%; margin-left:0px;">
                <a class="btn disabled text-muted" href="{:merge_url('half_stats',['state'=>1]);}">统计</a></li>
        </ul>
    </div>
</div>
<div class="col-xs-12 text-center">
    <h3>34时间管理</h3>
    <h4 id="plan_time_id" lay-key="12" >{:to_date($date,'Y年m月d日');}</h4>
</div>
<div class="row m-t-xs  p-t-5 " id='content_replace'>
    {php}
        echo $list_html??'';
    {/php}
</div>
<div class="row text-center" style ="line-height: 8rem;" >
    <span style='backgroud-color:white;'>&nbsp;</span>
</div>
<script src="//tencent.beecdn.cn/libs/highcharts/6.1.3/highcharts.js"></script>
<script src="//tencent.beecdn.cn/libs/iCheck/1.0.2/icheck.min.js"></script>
<script>
    $(function($){
               laydate.render ({
            elem: '#plan_time_id'
            , format: 'yyyy年MM月dd日'
            ,done: function(value, date, endDate){
                location.href="{:merge_url('',['date'=>$date]);}&date="+value;
              console.log(value); //得到日期生成的值，如：2017-08-18
            }
        });
        $(".change_tab").on('click',function(event) {
            event.preventDefault();
            change_teb(this);
            get_content(this);
    });
    
        function change_teb(ele) {
            $(".change_tab").removeClass('activity');
            $(ele).addClass("activity");
        }
        
        function get_content(ele) {
            let url =$(ele).children('a').attr('href'); 
            $.get(url,{},function(res) {
                  $("#content_replace").html(res);
                     $('input').iCheck({
                            checkboxClass: 'iradio_square-blue',
                            radioClass: 'iradio_square-blue',
                            increaseArea: '50%' // optional
                        });
        })
        }
    });
    
       function error_layer (msg)
        {
            layer.open ({
                content: msg,
                btn: '关闭',
                yes: function ()
                {
                    layer.closeAll ();
                }
            });
        }

        function success_layer (msg)
        {
            layer.open ({
                content: msg,
                btn: '关闭',
                yes: function ()
                {
                    layer.closeAll ();
                }
            });
        }
</script>